<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>jquery和dom之间的互转</title>
		<script src="../js/jquery-3.4.1.min.js"></script>
		<script>
			//jquery<=>dom
			$(function(){
				$("#B1").click(function(){
					let d=$("#d1");
					let d2=d[0];
					d2.innerHTML="这是一个div";
				});
				$("#B2").bind("click",function(){
					let d2=document.getElementById("d2");
					
					$(d2).html("<a href='#'>淘宝</a>");
				});
			});
		</script>
	</head>
	<body>
		<div id="d1">
			d1
		</div>
		<p id="d2"></p>
		<button id="B1">修改</button>
		<button id="B2">修改2</button>
	</body>
</html>
